<template>
  <div class="dashboard-page">
    <div class="container">
      <h1>仪表盘</h1>
      <div class="dashboard-content">
        <div class="dashboard-card">
          <h2>碳排放统计</h2>
          <p>本周减排: 5.2kg CO2</p>
          <p>本月减排: 18.7kg CO2</p>
          <p>累计减排: 127kg CO2</p>
        </div>
        
        <div class="dashboard-card">
          <h2>进行中的挑战</h2>
          <div class="challenge-list">
            <div class="challenge-item">
              <h3>无塑生活周挑战</h3>
              <div class="progress-container">
                <div class="progress-bar" style="width: 43%"></div>
              </div>
              <p>已完成 3/7 天</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DashboardView'
}
</script>

<style scoped>
.dashboard-page {
  padding: 20px;
}

.dashboard-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.dashboard-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

.challenge-list {
  margin-top: 15px;
}

.challenge-item {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.progress-container {
  width: 100%;
  height: 8px;
  background-color: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-bar {
  height: 100%;
  background-color: #4CAF50;
  border-radius: 4px;
}
</style> 